﻿using Abp.Timing;
using SOEI.Solution.Integratedes.ElectronicSignet;
using System;
using System.Collections.Generic;
using System.Text;

namespace SOEI.Solution.StructEntities.Organization
{
    public class OurOrganiPerson
    {
        /// <summary>
        /// 对应的人员编号（RYBH）字段
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 人员名称
        /// </summary>
        public string RYMC { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>

        public string LXDH { get; set; }

        /// <summary>
        /// 身份证
        /// </summary>

        public string SFZH { get; set; }

        /// <summary>
        /// 所属机构编号
        /// </summary>
        public string JGBH { get; set; }

        /// <summary>
        /// 授权名称
        /// </summary>
        public string SQMC {
            get {
                if (this.SignetGrant is null)
                    return "未授权";
                if (this.SignetGrant.SQFS == Customized.EGrantType.Alway)
                    return "永久授权";
                if (this.SignetGrant.SXRQ.Ticks > Clock.Now.Ticks)
                {
                    return "已授权";
                }
                else {
                    return "已失效";
                }
                
            }
        }

        /// <summary>
        /// 印章授权表
        /// </summary>
        public SignetGrant SignetGrant { get;set;}
    }
}
